All Questions
19 questions
6votes
4answers
685views
C++ custom string class implementation
I recently had an interview where I was tasked with implementing a custom C++ string class without using the STL. The interviewer provided the function signatures and variable declarations, specifying ...
7votes
1answer
2kviews
String literals concatenation with support for dynamic strings
I have implemented a function to concatenate string literals at compile time. Basic requirements: Very simple API. Can be used as a one-liner. Must accept variadic string literals. Highly optimized ...
3votes
1answer
362views
High performance 3 Way Quick Sort Implementation
My implementation of 3 way quick sort for strings. It supposed to sort very large set of 800,000,000 objects. This is why I added ...
4votes
0answers
73views
formatting flattened string into JSON-like object in C++, part 2
I have reworked the code from my previous (linked) post. For reference: I have a string which contains JSON-like object flattened (stringify()ed). I need to JSON-...
9votes
6answers
1kviews
Convert program arguments to std::wstring
Due to recent need I wrote a simple main function that has the goal to convert the C-style strings and arrays into a more STL-style. Then because I also had a need ...
3votes
0answers
82views
Early Stages of floating point class template in C++
I'm currently designing a class template to represent scientific notation or a floating-point number system. There are currently 4 distinct types: BIN, ...
8votes
3answers
2kviews
Reverse each word in the string. All spaces in the string should be retained
This was part of a code challenge. I use them to help me learn c++/c# along with tutorials and guides. Basically I was taking a string... The quick brown fox jumps over the lazy dog. ...and ...
1vote
1answer
78views
Better to use string concatenation using std::string::operator+() or std::string::reserve() and std::string::append()? [closed]
I'm doing some code review and I saw something like the following: ...
-1votes
1answer
39views
Provide one file where all error messages are defined in c++ [closed]
I would like to store all error messages in one file and call them for example with ...
3votes
3answers
377views
String Zigzag Conversion
Overview The string 0123456789 is written in a zigzag pattern (following the path going all the way down, then diagonally moving towards the top right) using a ...
8votes
1answer
442views
A string_splitter using C++17
In this repo I've put together a header only string splitter, allowing for characters and string literals as delimiters. The (little) library is strictly C++17. I would like to ask for your comments....
3votes
1answer
753views
Variadic strcat for c++17
On some video from CPPcon, some one said that there should be variadic overload for operator+ as it can solve allocation when there are multiple ...
2votes
1answer
1kviews
Template function for splitting strings in C++
I'd like to write a function to split strings in C++ to check my template learning. I've also read some relavent questions in this site but most of them don't use templates or ...
9votes
3answers
2kviews
C++ edit distance / string similarity function based on the Jaro-Winkler algorithm
I wrote a short library function, based on an example from Rosetta, to compare two strings and determine similarity, using Jaro-Winkler. A short copy-paste ready example: main.cpp ...
25votes
4answers
45kviews
Create a C++ string using printf-style formatting
It's often convenient to use C-style printf format strings when writing C++. I often find the modifiers much simpler to use than C++ I/O manipulators, and if I'm ...